﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="mywDetail.aspx.cs" Inherits="wDetail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <h2>通緝令細項</h2>
        <asp:DetailsView ID="wDetailsView" runat="server" AutoGenerateRows="False" DataKeyNames="WId"
            DataSourceID="SqlDataSource1" Height="50px" Width="100%">
            <Fields>
                <asp:BoundField DataField="WGName" HeaderText="物品名稱" SortExpression="WGName" />
                <asp:BoundField DataField="WGBrand" HeaderText="品牌" SortExpression="WGBrand" />
                <asp:BoundField DataField="WId" HeaderText="WId" ReadOnly="True" SortExpression="WId"
                    Visible="False" />
                <asp:BoundField DataField="WStart" DataFormatString="{0:D}" HeaderText="上架日期" SortExpression="WStart" />
                <asp:BoundField DataField="WEnd" DataFormatString="{0:D}" HeaderText="結束日期" SortExpression="WEnd" />
                <asp:BoundField DataField="WTran" HeaderText="商品配送方式" SortExpression="WTran" />
                <asp:CheckBoxField DataField="WVisible" HeaderText="WVisible" SortExpression="WVisible"
                    Visible="False" />
                <asp:BoundField DataField="WGApp" HeaderText="商品用途" SortExpression="WGApp" />
                <asp:BoundField DataField="WGAmount" HeaderText="數量" SortExpression="WGAmount" />
                <asp:BoundField DataField="WGDescription" HeaderText="商品描述" SortExpression="WGDescription" />
                <asp:BoundField DataField="WGYear" DataFormatString="{0:yyyy-MM}" HeaderText="製造年份"
                    SortExpression="WGYear" />
                <asp:BoundField DataField="WGMadeIn" HeaderText="產地" SortExpression="WGMadeIn" />
                <asp:BoundField DataField="WGBudget" DataFormatString="{0:C}" HeaderText="預算" SortExpression="WGBudget" />
                <asp:BoundField DataField="WNote" HeaderText="備註" SortExpression="WNote" />
                <asp:BoundField DataField="WGPId" HeaderText="WGPId" SortExpression="WGPId" Visible="False" />
                <asp:BoundField DataField="GCthird" HeaderText="商品種類" SortExpression="GCthird" />
                <asp:BoundField DataField="HCName" HeaderText="交易狀態" SortExpression="HCName" />
                <asp:ImageField DataImageUrlField="GPServName" 
                    DataImageUrlFormatString="~/thumb/{0}" HeaderText="通緝圖片">
                </asp:ImageField>
                <asp:HyperLinkField DataNavigateUrlFields="WId" 
                    DataNavigateUrlFormatString="~/nList.aspx?WId={0}" HeaderText="交涉清單" 
                    Text="點我查看所有交涉" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:projectConnectionString %>"
            
            
            SelectCommand="SELECT Wanted.WId, Wanted.WStart, Wanted.WEnd, Wanted.WTran, Wanted.WVisible, Wanted.WGApp, Wanted.WGAmount, Wanted.WGName, Wanted.WGDescription, Wanted.WGYear, Wanted.WGBrand, Wanted.WGMadeIn, Wanted.WGBudget, Wanted.WNote, Wanted.WGPId, GoodsCategory.GCthird, HistoryCategory.HCName, GoodsPic.GPServName FROM Wanted INNER JOIN GoodsCategory ON Wanted.GCId = GoodsCategory.GCId INNER JOIN HistoryCategory ON Wanted.HCId = HistoryCategory.HCId INNER JOIN GoodsPic ON Wanted.WGPId = GoodsPic.GPId WHERE (Wanted.WId = @WId)">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="1" Name="WId" QueryStringField="id" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br/>
    </div>
</asp:Content>
